package com.example.quickstart;

/**
 * 目标：面向对象编程快速入门
 */
public class Test {
    public static void main(String[] args) {
        // 1.创建一个学生对象,封装小雨的数据
        Student s1 = new Student();
        // 给对象的属性赋值
        s1.name = "小雨";
        s1.chinese = 100;
        s1.math = 100;
        //  调用s1对象的方法
        s1.printTotalScore();
        s1.printAverageScore();

        // 2.再创建一个学生对象,封装播仔的数据
        Student s2 = new Student();
        s2.name = "播仔";
        s2.chinese = 59;
        s2.math = 100;
        s2.printTotalScore();
        s2.printAverageScore();

        // 3.打印两个学生对象的地址
        System.out.println(s1);
        System.out.println(s2);
    }
}
